
@echo off
setlocal enabledelayedexpansion

:: 追踪所有
echo Adding all changes...
git add .

:: Commit 等待输入message
echo Waiting for commit message...
git commit

:: 检查是否有任何冲突前尝试pull
echo Checking for conflicts before pulling...
if not errorlevel 1 (
    :: Pull the changes
    echo Pulling changes...
    git pull sjy doc --rebase
    if not errorlevel 1 (
        :: Push the changes
        echo Pushing changes...
        git push sjy doc
        echo Commit and push completed successfully.
    ) else (
        echo Error: Pull failed.
    )
) else (
    echo Error: Commit failed.
)
endlocal